<HTML><HEAD>
<!--
    ---------------
    StatusBar Clock
    ---------------
-->

<SCRIPT LANGUAGE="JavaScript"><!-- hide from old browsers

/*
    THE JAVASCRIPT COOKBOOK by Erica Sadun, webrx@mindspring.com
    Copyright (C)2000 by Charles River Media.  All Rights Reserved.
    
    This applet can only be re-used or modifed by license holders of the
    JavaScript Cookbook CD-ROM.  Credit must be given in the source
    code and this copyright notice must be maintained. If you do
    not hold a license to the JavaScript Cookbook, you may NOT
    duplicate or modify this code for your own use.

    Use at your own risk. No warranty is given or implied of the suitability 
    of this applet for any specific application. Neither Erica Sadun nor 
    Charles River Media will be held responsible for any unwanted effects 
    due to the use of this applet or any derivative. 
*/

function setMessage()
{
    now = new Date()
    window.status = ("The time is "+now.getHours())+":"+(""+now.getMinutes())
}

<!-- done hiding --></SCRIPT></HEAD>

<BODY bgcolor="ffffff" link="0000ff" vlink="770077">
    
    <FONT COLOR="007777"><H1><IMG SRC="../GRAFX/UTENS.JPG" WIDTH=80 HEIGHT=50
    ALIGN = LEFT>StatusBar Clock #1</H1></FONT>
    <BLOCKQUOTE><FONT COLOR="770000">
        This script sets the status bar text to the current
        time when a button is pressed.<p>
    </FONT></BLOCKQUOTE>
    
    <CENTER><FORM>
        <INPUT TYPE="button" VALUE="CHECK THE TIME"
        onClick="setMessage()">
    </FORM></CENTER>

    <BR><BR>
    
    <FONT COLOR="007777"><H2>Discussion</H2></FONT>
    <FONT SIZE=4>
        This script uses the function
        <FONT color=770000">setMessage()</FONT>
        to set the status bar's text by changing the
        <FONT color=770000">window.status</FONT> object.
        Some early Netscape Navigator 2.0 releases do
        not produce the correct time. This will be fixed
        in future releases.
        
        <h3>The function setMessage</h3>        
        <font color="770000"><pre><null
        >function setMessage()<br><null
        >{<br><null
        >    now = new Date()<br><null
        >    window.status = now.toGMTString()<br><null
        >}<br><null
        </pre></font>
    </FONT>        

</BODY>
</HTML>



<h5>Copyright ©2000 by Charles River Media, All Rights Reserved</h5>
</BODY>
</HTML>